package com.fireBird.ai.flower.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fireBird.ai.flower.entity.Flower;
import com.fireBird.ai.flower.repository.FlowerRepository;
import com.fireBird.ai.flower.service.FlowerService;

@Service
public class FlowerServiceImpl implements FlowerService {

    @Autowired
    FlowerRepository repository;

    @Override
    public Flower getFlowerById(Integer id) {
        //有两种方式：
        //1.调用crudRepository的接口
//        return repository.findOne(id);
        //2.调用我们自己写的接口
        return repository.getFlowerById(id);
    }

    @Override
    public Flower getFlowerByCode(String code) {
        return repository.getFlowerByCode(code);
    }

}